package tamavo.entities
{
	import mx.collections.ArrayCollection;
	
	import tamavo.dao.ProcessDAO;

	[Bindable]
	public class Plan
	{
		public var name:String;
		public var id:String;
		public var procs:String;
		
		private var _processes:ArrayCollection;
		public function get processes():ArrayCollection
		{
			_processes = new ArrayCollection();
			var dao:ProcessDAO = new ProcessDAO();
			for each(var id:String in this.procs.split(',')){
				var proc:Process = dao.findById(id);
				if (proc != null)
					_processes.addItem(proc);
			}
			return _processes;
		}
		
		public function set processes(processes:ArrayCollection):void
		{
			_processes = processes;
		}
	}
}